package com.wdl.modules.myhouse.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wdl.modules.myhouse.entity.FileEntity;
import com.wdl.modules.myhouse.vo.FileVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * 文件表
 *
 * @author lucain sunlightcs@gmail.com
 * @since 1.0.0 2022-08-13
 */
@Mapper
@Repository
public interface FileDao extends BaseMapper<FileEntity> {


    /**
     * @param yearAndMon 按照年月查询当月的文件上传统计数据
     * @return
     */
    @MapKey("day")
     Map<String,Integer> selectFileNumByUploadTime(@Param("yearAndMon")String yearAndMon);

    @MapKey("day")
    Map<String, Integer> downLoadStatistic(String s);

    /**
     * 根据文件id连表获取文件信息
     * @param id
     * @return
     */
    FileVo getFileDetailById(@Param("id") Long id);


}